package com.iman.manjusri.mappers;

import com.iman.manjusri.mappers.models.DrmStudyCoin;
import com.iman.manjusri.mappers.models.DrmStudyCoinExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface DrmStudyCoinMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int countByExample(DrmStudyCoinExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int deleteByExample(DrmStudyCoinExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Delete({
        "delete from drm_study_coin",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Insert({
        "insert into drm_study_coin (id, rmb_cnt, ",
        "scoin_cnt, create_dt, ",
        "use_yn)",
        "values (#{id,jdbcType=INTEGER}, #{rmbCnt,jdbcType=INTEGER}, ",
        "#{scoinCnt,jdbcType=INTEGER}, #{createDt,jdbcType=TIMESTAMP}, ",
        "#{useYn,jdbcType=INTEGER})"
    })
    int insert(DrmStudyCoin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int insertSelective(DrmStudyCoin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    List<DrmStudyCoin> selectByExample(DrmStudyCoinExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Select({
        "select",
        "id, rmb_cnt, scoin_cnt, create_dt, use_yn",
        "from drm_study_coin",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    DrmStudyCoin selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmStudyCoin record, @Param("example") DrmStudyCoinExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByExample(@Param("record") DrmStudyCoin record, @Param("example") DrmStudyCoinExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    int updateByPrimaryKeySelective(DrmStudyCoin record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_study_coin
     *
     * @mbggenerated Sun Mar 22 08:54:43 CST 2015
     */
    @Update({
        "update drm_study_coin",
        "set rmb_cnt = #{rmbCnt,jdbcType=INTEGER},",
          "scoin_cnt = #{scoinCnt,jdbcType=INTEGER},",
          "create_dt = #{createDt,jdbcType=TIMESTAMP},",
          "use_yn = #{useYn,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DrmStudyCoin record);
}